import { defineStore } from 'pinia';
import * as bannerApi from '@/api/banner';

export const useBannerStore = defineStore('banner', () => {
	async function getBanners(param?: any) {
		uni.showLoading();
		const response = await bannerApi.getBanners(param);
		uni.hideLoading();
		if (response.code === 20000) {
			return response.data.banners;
		}
		return [];
	}

	return {
		getBanners
	};
});
